Utilities to write tests.
More...
|
static void | check (bool condition, nkMemory::StringView message="") |
|
template<typename T > |
static void | areEqual (const T &a, const T &b, nkMemory::StringView message="") |
|
template<typename T > |
static std::enable_if_t<!std::is_pointer_v< T >, void > | areEqual (T a, T b, T precision, nkMemory::StringView message="") |
|
template<typename T > |
static void | areNotEqual (const T &a, const T &b, nkMemory::StringView message="") |
|
template<typename T > |
static std::enable_if_t<!std::is_pointer_v< T >, void > | areNotEqual (T a, T b, T precision, nkMemory::StringView message="") |
|
template<typename T > |
static void | isNull (T *p, nkMemory::StringView message="") |
|
template<typename T > |
static void | isNotNull (T *p, nkMemory::StringView message="") |
|
Utilities to write tests.
◆ check()
Allows to check a condition and fail if it resolves to false.
- Parameters
-
condition | The condition to check for. |
message | The message to provide in case of a failure. |
◆ areEqual() [1/2]
template<typename T >
static void nkDebug::TestUtils::areEqual |
( |
const T & |
a, |
|
|
const T & |
b, |
|
|
nkMemory::StringView |
message = "" |
|
) |
| |
|
static |
Checks that two objects are equal, failing if it's not the case.
- Parameters
-
a | The a member of the equality check. |
b | The b member of the equality check. |
message | The message to provide in case of a failure. |
◆ areEqual() [2/2]
template<typename T >
static std::enable_if_t<!std::is_pointer_v<T>, void> nkDebug::TestUtils::areEqual |
( |
T |
a, |
|
|
T |
b, |
|
|
T |
precision, |
|
|
nkMemory::StringView |
message = "" |
|
) |
| |
|
static |
Checks that two objects are equal, failing if it's not the case.
- Parameters
-
a | The a member of the equality check. |
b | The b member of the equality check. |
precision | The maximal numerial precision the equality should satisfy (for instance, a check of equality with 2.f with precision of 0.1f will accept a range between 1.9f and 2.1f). |
message | The message to provide in case of a failure. |
◆ areNotEqual() [1/2]
template<typename T >
static void nkDebug::TestUtils::areNotEqual |
( |
const T & |
a, |
|
|
const T & |
b, |
|
|
nkMemory::StringView |
message = "" |
|
) |
| |
|
static |
Checks that two objects are not equal, failing if it's not the case.
- Parameters
-
a | The a member of the equality check. |
b | The b member of the equality check. |
message | The message to provide in case of a failure. |
◆ areNotEqual() [2/2]
template<typename T >
static std::enable_if_t<!std::is_pointer_v<T>, void> nkDebug::TestUtils::areNotEqual |
( |
T |
a, |
|
|
T |
b, |
|
|
T |
precision, |
|
|
nkMemory::StringView |
message = "" |
|
) |
| |
|
static |
Checks that two objects are not equal, failing if it's not the case.
- Parameters
-
a | The a member of the equality check. |
b | The b member of the equality check. |
precision | The maximal numerial precision the equality should satisfy (for instance, a check of equality with 2.f with precision of 0.1f will reject a range between 1.9f and 2.1f). |
message | The message to provide in case of a failure. |
◆ isNull()
Checks that a pointer is null, failing if it's not the case.
- Parameters
-
p | The pointer to check. |
message | The message to provide in case of a failure. |
◆ isNotNull()
Checks that a pointer is not null, failing if it's not the case.
- Parameters
-
p | The pointer to check. |
message | The message to provide in case of a failure. |
The documentation for this class was generated from the following file: